package com.tongji.housediy.controller.brandCMD
{
	import com.tongji.housediy.events.brandEvent.GetGoodsByBrandEvent;
	import com.tongji.housediy.model.BrandModel;
	import com.tongji.housediy.service.BrandService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author yanghanbing
	 * 2011/5/06
	 */ 
	public class GetGoodsByBrandCMD extends Command
	{
		[Inject]
		public var service:BrandService;
		
		[Inject]
		public var event:GetGoodsByBrandEvent;
		
		[Inject]
		public var model:BrandModel;
		
		override public function execute():void
		{
			switch(event.type)
			{
				case "getGoodsByBrandID":
					service.getGoodsByBrand(event.brandID);
					break;
				case "updateGoodsBrand":
					model.updateGoodsList(event.goodsSorts);
					break;
			}				
		}
	}
}